# $Id: PKGBUILD 48231 2009-10-13 17:00:49Z GunsNRose$
# Maintainer : GunsNRose<3444542@163.com>
pkgname=at91-kernel
pkgver=2.6.30
pkgrel=1
pkgdesc="at91 kernel"
url="http://www.at91.com/linux4sam/bin/view/Linux4SAM/LinuxKernel"

#install=${pkgname}.install
groups=('embedded')
#"http://www.kernel.org/pub/linux/kernel/v2.6/linux-${pkgver}.tar.bz2" 
#"ftp://gentoo.anheng.com.cn/gentoo/distfiles/linux-${pkgver}.tar.bz2" 

source=("http://61.135.158.199/distfiles/linux-${pkgver}.tar.bz2" \
    "http://maxim.org.za/AT91RM9200/2.6/${pkgver}-at91.patch.gz" \
    "ftp://www.at91.com/pub/linux/${pkgver}-at91/at91sam9260ek_defconfig" \
    "ftp://www.at91.com/pub/linux/${pkgver}-at91/${pkgver}-at91-exp.tar.gz")

arch=('i686')
#makedepends=("xz-utils")

options=('emptydirs')
depends=('arm-2008q3')
#depends=('libusb')

license=('GPL')
md5sums=('7a80058a6382e5108cdb5554d1609615'
        'f13ab353b11329ce3d605b6f40e77fa6'
        'f0841539392224f3f520cdb1c3f23f6d'
        'e745481c53ff106b83df22a5aabc56ae')

build() {
    echo "${pkgver}-at91-exp"
    echo "${source[@]}"
    echo "pwd = ${PWD}"
    cd ${srcdir}/linux-${pkgver} || return 1
    patch -Np1 -i ${srcdir}/${pkgver}-at91.patch || return 1
    for p in $(ls ${srcdir}/${pkgver}-at91-exp); do
        echo "patch -Np1 -i ${srcdir}/${pkgver}-at91-exp/$p"
        patch -Np1 -i ${srcdir}/${pkgver}-at91-exp/$p  || return 1
    done
    cp ${startdir}/at91sam9260ek_defconfig ./ || return 1
    cp ${startdir}/at91sam9260ek_defconfig ./.config || return 1
    make ARCH=arm oldconfig || return 1
    make ARCH=arm  CROSS_COMPILE=arm-none-linux-gnueabi- || return 1
    make ARCH=arm INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
}

#45-jlink.rules  JLinkExe  libjlinkarm.so  libjlinkarm.so.0  libjlinkarm.so.0.0  README  start


